Optimal. Leaf size=57 \[ \frac {x}{a^2}-\frac {5 \sin (c+d x)}{3 a^2 d (1+\cos (c+d x))}+\frac {\sin (c+d x)}{3 d (a+a \cos (c+d x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2837, 2814,
2727} \begin {gather*} -\frac {5 \sin (c+d x)}{3 a^2 d (\cos (c+d x)+1)}+\frac {x}{a^2}+\frac {\sin (c+d x)}{3 d (a \cos (c+d x)+a)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2727
Rule 2814
Rule 2837
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x)}{(a+a \cos (c+d x))^2} \, dx &=\frac {\sin (c+d x)}{3 d (a+a \cos (c+d x))^2}+\frac {\int \frac {-2 a+3 a \cos (c+d x)}{a+a \cos (c+d x)} \, dx}{3 a^2}\\ &=\frac {x}{a^2}+\frac {\sin (c+d x)}{3 d (a+a \cos (c+d x))^2}-\frac {5 \int \frac {1}{a+a \cos (c+d x)} \, dx}{3 a}\\ &=\frac {x}{a^2}+\frac {\sin (c+d x)}{3 d (a+a \cos (c+d x))^2}-\frac {5 \sin (c+d x)}{3 d \left (a^2+a^2 \cos (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.25, size = 105, normalized size = 1.84 \begin {gather*} \frac {2 \cos \left (\frac {1}{2} (c+d x)\right ) \left (6 d x \cos ^3\left (\frac {1}{2} (c+d x)\right )+\sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )-10 \cos ^2\left (\frac {1}{2} (c+d x)\right ) \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+\cos \left (\frac {1}{2} (c+d x)\right ) \tan \left (\frac {c}{2}\right )\right )}{3 a^2 d (1+\cos (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 46, normalized size = 0.81
method | result | size |
derivativedivides | \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}-3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+4 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(46\) |
default | \(\frac {\frac {\left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}-3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+4 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d \,a^{2}}\) | \(46\) |
risch | \(\frac {x}{a^{2}}-\frac {2 i \left (6 \,{\mathrm e}^{2 i \left (d x +c \right )}+9 \,{\mathrm e}^{i \left (d x +c \right )}+5\right )}{3 d \,a^{2} \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )^{3}}\) | \(53\) |
norman | \(\frac {\frac {x}{a}+\frac {x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 a d}-\frac {17 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}-\frac {7 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}+\frac {\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )}{6 a d}+\frac {2 x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} a}\) | \(133\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 72, normalized size = 1.26 \begin {gather*} -\frac {\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}}}{a^{2}} - \frac {12 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.43, size = 80, normalized size = 1.40 \begin {gather*} \frac {3 \, d x \cos \left (d x + c\right )^{2} + 6 \, d x \cos \left (d x + c\right ) + 3 \, d x - {\left (5 \, \cos \left (d x + c\right ) + 4\right )} \sin \left (d x + c\right )}{3 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} + 2 \, a^{2} d \cos \left (d x + c\right ) + a^{2} d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.67, size = 56, normalized size = 0.98 \begin {gather*} \begin {cases} \frac {x}{a^{2}} + \frac {\tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{6 a^{2} d} - \frac {3 \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{2 a^{2} d} & \text {for}\: d \neq 0 \\\frac {x \cos ^{2}{\left (c \right )}}{\left (a \cos {\left (c \right )} + a\right )^{2}} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 50, normalized size = 0.88 \begin {gather*} \frac {\frac {6 \, {\left (d x + c\right )}}{a^{2}} + \frac {a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 9 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{6}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.36, size = 35, normalized size = 0.61 \begin {gather*} \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-9\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+6\,d\,x}{6\,a^2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________